package com.artPreter.service.impl;

import com.artPreter.pojo.ArtistTemp;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;

import com.artPreter.mapper.ArtistMapper;
import com.artPreter.pojo.Artist;
import com.artPreter.pojo.ArtistTemp;
import com.artPreter.mapper.ArtistTempMapper;
import com.artPreter.service.IArtistTempService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 艺术家模板内容表 服务实现类
 * </p>
 *
 * @author jarvis
 * @since 2024-11-23
 */
@Service
public class ArtistTempServiceImpl extends ServiceImpl<ArtistTempMapper, ArtistTemp> implements IArtistTempService {


    @Override
    public ArtistTemp getArtistTemp(ArtistTemp artistTemp) {
        LambdaQueryWrapper<ArtistTemp> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(ArtistTemp::getArtistId,artistTemp.getArtistId());
        List<ArtistTemp> list = this.baseMapper.selectList(lambdaQueryWrapper);
        if(list.size()>0){
            return list.get(0);
        }else{
            return null;

        }
    }
}
